Skip to content

test(cp): cover download progress edge cases#146

Merged
overtrue merged 1 commit intomainfrom
codex/test-gap-detection-20260421
Apr 21, 2026
Merged

test(cp): cover download progress edge cases#146
overtrue merged 1 commit intomainfrom
codex/test-gap-detection-20260421

Conversation

@overtrue
Copy link
Copy Markdown
Contributor

Related Issue(s)

No linked issue. This is from the recurring test-gap detection pass.

Background

Recent work added download progress reporting for large rc cp downloads. The existing tests covered the known-size threshold behavior, but two branches remained unasserted: downloads with unknown total size and output configurations that disable progress rendering.

Root Cause

The helper intentionally avoids creating progress for unknown content length and relies on OutputConfig to suppress visible progress bars when --no-progress is active. Without focused tests, those branches could regress during future transfer UI changes.

Solution

Added two focused unit tests for update_download_progress:

  • unknown total size keeps progress unset
  • no_progress creates state for a large transfer but keeps the progress bar hidden

Test Status

  • cargo test -p rustfs-cli commands::cp::tests::test_download_progress
  • cargo fmt --all --check
  • make pre-commit

@overtrue overtrue marked this pull request as ready for review April 21, 2026 01:13
@overtrue overtrue merged commit a02dfa8 into main Apr 21, 2026
15 checks passed
@overtrue overtrue deleted the codex/test-gap-detection-20260421 branch April 21, 2026 14:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant